﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using DodongosQuest.Items;


namespace DodongosQuest.Screens.Gameplay
{
    public class Inventory  
    {
        private Vector2 _position;
        private List<IItem> _playerInventory;
        private SpriteFont _font;
        private Vector2[] _inventoryPositions;

        public Inventory(Vector2 position, List<IItem> playerInventory)
        {
            _position = position;
            _playerInventory = playerInventory;
            _font = Game1.ContentManager.Load<SpriteFont>("SmallFont");
            _inventoryPositions = new Vector2[10];

            for(int i = 0; i < 10; i++)
                _inventoryPositions[i] = new Vector2(0, (i * 10) + 25);
        }

        public void Draw(GameTime gameTime)
        {
            for (int i = 0; i < 10; i++)
            {
                if (_playerInventory.Count > i)
                {
                    string message = "[" + i + "] " + _playerInventory[i].Name;
                    Game1.SpriteBatch.DrawString(_font, message, new Vector2(_position.X + _inventoryPositions[i].X, _position.Y + _inventoryPositions[i].Y), Color.White);
                }
            }
        }

        public void Update(GameTime gameTime)
        {
        }
    }
}
